pp108 : Providing Log Configuration Details

Providing Log Configuration Details

This topic describes process to provide log configuration details


You must configure the log categories for the security levels after they are registered. Refer to Log Configuration for more details. Also, you can specify the log consumers to which the log messages can be published.

Configuring the Severity Levels and Log Consumers

Follow the steps described below to configure the severity levels and select log consumers for publishing the log message

  1. Create a Service Container.
  2. In the Provide Log Configuration Details screen, the severity levels for the registered log categories are displayed. Choose from either of the following:
    • Enable System Policy - This option disables all the log categories and severities, since the system-level configuration is applied. On enabling the System Policy option, the Log4jConfiguration.xml gets applied to a particular Service Container.
    • Enable Logging - This option allows you to enable the log categories and severities. Do the following after selecting the option to Enable Logging:
      • Select Root Severity to turn the log option on for all the severity levels, including those that are not listed on the screen. The severity levels selected here would apply to all the categories.
        Note: Enabling the lowest severity level automatically enables the remaining severity levels. Similarly, enabling or selecting the highest severity level enables only that severity. For example, selecting the Debug option enables all the options (Debug, Info, Warn, Error and Fatal). Disabling Fatal (clearing the check box for Fatal) disables the remaining severity levels. Selecting the severity Fatal does not enable other Severities.
      • In the Category-wise Severities, select the severity for a specific category.
        • Selecting the Root Severity automatically turns the category-wise severity option on for all the categories
        • After enabling the Root Severity, you can clear the severities for any category. This would take precedence over the root-level severity.
        • Enabling the Root Severity and clearing the options for all category-wise severities shown in the screen, enables the severities for custom categories that are not listed.

          Note: If a <severity> option is selected under both Root Severities as well as Category-wise Severities, the option selected under Category-wise Severities takes precedence.

  3. Select the log consumer in the Logger Consumers pane. Refer Log Consumers for more information.

    Note:

    • If the details are not specified as above (LDAP-based configuration), an advanced user can directly modify and save the configuration details in the Process Platform logger configuration file (Log4jConfiguration.xml ) available at <Process_Platform_Installation_Directory>/config folder.
    • The standard log file as specified through the system policy (Log4jconfiguration.xml ) will always be created to log the messages while starting the Service Container. If the Service Container is configured for logging as specified in the steps above, then during the startup process, logging activity will switch to the Processor-specific log file.
    • Use System Policy for logger configuration when a Service Container is configured to an OS Process. The log messages for that Service Container are logged to an OS Process-specific log file, that is, <OS Process Name.xml>.

Enabling Logging for Gateway

  1. Modify the logger configuration file, as specified in the example, to enable logging for gateway.

    Note: If the log configuration details are provided during Service Container configuration (as described in this section), then those would automatically be implemented.

    The logger configuration takes care of the logging at the Gateway level. Modifying the configuration details in the configuration file automatically takes care of the changes to the logger at the Gateway level. The default code is as follows:

    <!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <renderer renderedClass="com.eibus.util.logger.internal.LocalizableLogMessage" renderingClass="com.eibus.util.logger.internal.TextRenderer"/> <renderer renderedClass="com.eibus.util.logger.internal.LogMessage" renderingClass="com.eibus.util.logger.internal.TextRenderer"/> <appender class="com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender" name="file"> <param name="File" value="%LN.xml"/> <param name="DatePattern" value="&amp;apos;.&amp;apos;yyyy-MM-dd"/> <layout class="org.apache.log4j.xml.XMLLayout"/> </appender> <category name="Cordys.com.eibus.management.AlertSystem"> <priority value="info"/> </category> <root> <priority value="error"/> <appender-ref ref="file"/> </root> </log4j:configuration> 
  2. Add the following lines:
    <category name='com.eibus.web'> <priority value ='info'/> </category> 

    This enables the logging for gateway and gateway applications. However, depending on the specific gateway application for which logging must be enabled, you must provide the precise package or category details for that gateway application. For example, to enable logging for wsdl gateway, the category name must be com.eibus.web.tools.wsdl.
    Note: The priority value can be set to debug, info, warn, error, and fatal.

    The modified sample code look would like the one shown below:

    <!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <renderer renderedClass="com.eibus.util.logger.internal.LocalizableLogMessage" renderingClass="com.eibus.util.logger.internal.TextRenderer"/> <renderer renderedClass="com.eibus.util.logger.internal.LogMessage" renderingClass="com.eibus.util.logger.internal.TextRenderer"/> <appender class="com.eibus.util.logger.appender.ProcessNamedDailyRollingFileAppender" name="file"> <param name="File" value="%LN.xml"/> <param name="DatePattern" value="&amp;apos;.&amp;apos;yyyy-MM-dd"/> <layout class="org.apache.log4j.xml.XMLLayout"/> </appender> <category name="Cordys.com.eibus.management.AlertSystem"> <priority value="info"/> </category> <category name="com.eibus.web"> <priority value="info"/> </category> <root> <priority value="error"/> <appender-ref ref="file"/> </root> </log4j:configuration>

Customizing Logging

  • Customizing categories : Custom categories can be added to the logger configuration as described below:
    • Enabling logging for a package: The package name must be specified in the category name for which the logging is to be enabled.
      <category name='packageName'> <priority value='info'/> <appender-ref ref='appenderReference'/> </category>
    • Enabling logging for a class: The class name must be specified in the category name for which the logging is to be enabled.
      <category name='ClassName'> <priority value='warn'/> <appender-ref ref='appenderReference'/> </category>
  • Customizing appenders : Logging for different appenders can be customized. For details, refer to Filters and Appenders. Note: The logger category must be specified as the category name.